import requests


class HttpReq(object):
    def __init__(self):
        self.headers = {"Content-Type": "application/json",
                        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36"
                        }
    # Get 请求
    def get(self,url='',data='',cookies=None):
        resp = requests.get(url,data=data,headers=self.headers,cookies=cookies)
        return resp
    # POST
    def post(self, url='', data='', cookies=None):
        resp = requests.post(url, data=data, headers=self.headers,cookies=cookies)
        return resp
    #PUT
    def put(self, url='', params='',data='', cookies=None):
        resp = requests.put(url,params=params, data=data, headers=self.headers,cookies=cookies)
        return resp
    #DELETE
    def delete(self, url='', data='', cookies=None):
        resp = requests.delete(url, data=data, headers=self.headers,cookies=cookies)
        return resp

ETReq = HttpReq()